package interview.huawei.tjt.training.huaweijishitiku;

import java.util.Scanner;

// 学英语
public class HJ42 {

    public static String[] str1 = new String[]{"zero","one","two","three","four","five","six","seven","eight","nine",
            "ten","eleven","twelve","thirteen","forteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"};
    public static String[] str2 = new String[]{"zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"};

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        while ( sc.hasNext() ) {
            long num = sc.nextInt();
            if ( num >= 1 && num <= 2000000 ) {
                System.out.println(getEn(num));
            } else {
                System.out.println("error");
            }

        }

    }

    public static String getEn ( long num ) {
        String stren = "error";
        if( num <= 20){
            stren = str1[(int)(num)];
        } else if(num < 100){
            long remainder = num % 10;
            if(remainder == 0){
                stren = str2[(int)(num)/10];
            } else {
                stren = str2[(int)(num)/10] + " " + str1[(int)(remainder)];
            }
        } else if(num < 1000){
            long remainder = num % 100;
            if(remainder == 0){
                stren = str1[(int)(num)/100] + " hundred";
            } else {
                stren = str1[(int)(num)/100] + " hundred and " + getEn(remainder);
            }
        } else if(num < 1000000){
            long remainder = num % 1000;
            if(remainder == 0){
                stren = getEn(num/1000) + " thousand";
            } else {
                stren = getEn(num/1000) + " thousand " + getEn(remainder);
            }
        } else if(num < 1000000000){
            long remainder = num % 1000000;
            if(remainder == 0){
                stren = getEn(num/1000000) + " million";
            } else {
                stren = getEn(num/1000000) + " million " + getEn(remainder);
            }
        }
        return stren;
    }

}
